package gui;

import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.JFrame;

import navigatore.AgenteNavigatore;

public class MainFrame extends JFrame {

	public MainPanel panel;
	public int dimx,dimy;
	
	public MainFrame() {
		
		panel = new MainPanel();
		
		dimx= 1100;
		dimy=750;
		
		this.setSize(dimx, dimy);
		
		this.setContentPane(panel);
		
		this.setVisible(true);
		
		this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
		
		Toolkit tk = Toolkit.getDefaultToolkit();
		
		Dimension dimScreen = tk.getScreenSize();
		
		this.setLocation((int)dimScreen.getWidth()/2-dimx/2, (int)dimScreen.getHeight()/2-dimy/2-15);
		
		addWindowListener(new ExitListener());
	}

	
	private class ExitListener extends WindowAdapter {
		
		public void windowClosing(WindowEvent event) {
			System.exit(0);
		}
	
	}
}
